package com.adulcimer.core.common;

import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor;

import java.util.Map;

/**
 * @author Simon
 * @create 2025/7/21
 * @Description 拦截器 用来拿数据或者向下传数据的
 **/
public class ChatWebSocketInterceptor extends HttpSessionHandshakeInterceptor {

    @Override
    public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response,
                                   WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception {

        //处理逻辑

        return super.beforeHandshake(request, response, wsHandler, attributes);
    }
}

